<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>简约个人博客</title>
    <style>
        /* 基础样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f8f9fa;
        }

        a {
            text-decoration: none;
            color: inherit;
        }

        ul {
            list-style: none;
        }

        img {
            max-width: 100%;
            height: auto;
        }

        .container {
            width: 90%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }

        .section {
            padding: 60px 0;
        }

        .section-title {
            text-align: center;
            margin-bottom: 40px;
            font-size: 2rem;
            color: #2c3e50;
            position: relative;
        }

        .section-title::after {
            content: '';
            display: block;
            width: 60px;
            height: 3px;
            background: #3498db;
            margin: 15px auto 0;
        }

        /* 导航栏样式 */
        .navbar {
            background-color: #fff;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }

        .nav-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 0;
        }

        .logo {
            font-size: 1.8rem;
            font-weight: 700;
            color: #3498db;
        }

        .nav-links {
            display: flex;
            gap: 30px;
        }

        .nav-links li a {
            font-weight: 500;
            transition: color 0.3s ease;
        }

        .nav-links li a:hover {
            color: #3498db;
        }

        .mobile-toggle {
            display: none;
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* 轮播图样式 */
        .carousel {
            position: relative;
            height: 500px;
            overflow: hidden;
            margin-top: 70px;
        }

        .carousel-inner {
            position: relative;
            width: 100%;
            height: 100%;
        }

        .carousel-item {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            transition: opacity 0.5s ease-in-out;
        }

        .carousel-item.active {
            opacity: 1;
        }

        .carousel-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .carousel-caption {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 20px;
            text-align: center;
        }

        .carousel-caption h3 {
            font-size: 1.8rem;
            margin-bottom: 10px;
        }

        .carousel-controls {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 20px;
        }

        .carousel-btn {
            background: rgba(0, 0, 0, 0.5);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            font-size: 1.5rem;
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .carousel-btn:hover {
            background: rgba(0, 0, 0, 0.8);
        }

        .carousel-indicators {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
        }

        .indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.5);
            cursor: pointer;
            transition: background 0.3s ease;
        }

        .indicator.active {
            background: white;
        }

        /* 文章介绍样式 */
        .articles {
            background-color: #fff;
        }

        .articles-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
        }

        .article-card {
            background: #fff;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .article-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        }

        .article-img {
            height: 200px;
            width: 100%;
            object-fit: cover;
        }

        .article-content {
            padding: 20px;
        }

        .article-date {
            color: #7f8c8d;
            font-size: 0.9rem;
            margin-bottom: 10px;
        }

        .article-title {
            font-size: 1.4rem;
            margin-bottom: 10px;
            color: #2c3e50;
        }

        .article-excerpt {
            color: #7f8c8d;
            margin-bottom: 15px;
        }

        .read-more {
            color: #3498db;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: gap 0.3s ease;
        }

        .read-more:hover {
            gap: 10px;
        }

        /* 个人信息样式 */
        .about {
            background-color: #f1f2f6;
        }

        .about-content {
            display: flex;
            align-items: center;
            gap: 50px;
        }

        .about-img {
            flex: 1;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .about-text {
            flex: 1;
        }

        .about-text h3 {
            font-size: 1.8rem;
            margin-bottom: 20px;
            color: #2c3e50;
        }

        .about-text p {
            margin-bottom: 20px;
            color: #555;
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 30px;
        }

        .social-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #3498db;
            color: white;
            transition: transform 0.3s ease, background 0.3s ease;
        }

        .social-link:hover {
            transform: translateY(-5px);
            background: #2980b9;
        }

        /* 页脚样式 */
        .footer {
            background: #2c3e50;
            color: white;
            text-align: center;
            padding: 30px 0;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .nav-links {
                position: fixed;
                top: 70px;
                left: -100%;
                width: 100%;
                height: calc(100vh - 70px);
                background: white;
                flex-direction: column;
                align-items: center;
                justify-content: flex-start;
                padding-top: 40px;
                transition: left 0.3s ease;
            }

            .nav-links.active {
                left: 0;
            }

            .mobile-toggle {
                display: block;
            }

            .about-content {
                flex-direction: column;
            }

            .carousel {
                height: 400px;
            }

            .section {
                padding: 40px 0;
            }

            .section-title {
                font-size: 1.6rem;
            }
        }

        @media (max-width: 480px) {
            .carousel {
                height: 300px;
            }

            .carousel-caption h3 {
                font-size: 1.4rem;
            }

            .carousel-caption p {
                font-size: 0.9rem;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="container nav-container">
            <a href="#" class="logo">MyBlog</a>
            <ul class="nav-links">
                <li><a href="#">首页</a></li>
                <li><a href="#">文章</a></li>
                <li><a href="#">关于</a></li>
                <li><a href="#">联系</a></li>
            </ul>
            <div class="mobile-toggle">☰</div>
        </div>
    </nav>

    <!-- 轮播图区域 -->
    <section class="carousel">
        <div class="carousel-inner">
            <div class="carousel-item active">
                <img src="https://picsum.photos/1200/500?random=1" alt="轮播图1" class="carousel-img">
                <div class="carousel-caption">
                    <h3>探索简约之美</h3>
                    <p>在这个快节奏的世界中，寻找内心的宁静</p>
                </div>
            </div>
            <div class="carousel-item">
                <img src="https://picsum.photos/1200/500?random=2" alt="轮播图2" class="carousel-img">
                <div class="carousel-caption">
                    <h3>技术与艺术的融合</h3>
                    <p>用代码创造美好的用户体验</p>
                </div>
            </div>
            <div class="carousel-item">
                <img src="https://picsum.photos/1200/500?random=3" alt="轮播图3" class="carousel-img">
                <div class="carousel-caption">
                    <h3>生活中的小确幸</h3>
                    <p>记录日常中的美好瞬间</p>
                </div>
            </div>
        </div>
        <div class="carousel-controls">
            <button class="carousel-btn prev">‹</button>
            <button class="carousel-btn next">›</button>
        </div>
        <div class="carousel-indicators">
            <span class="indicator active" data-slide="0"></span>
            <span class="indicator" data-slide="1"></span>
            <span class="indicator" data-slide="2"></span>
        </div>
    </section>

    <!-- 文章介绍区域 -->
    <section class="section articles">
        <div class="container">
            <h2 class="section-title">最新文章</h2>
            <div class="articles-grid">
                <div class="article-card">
                    <img src="https://picsum.photos/600/400?random=4" alt="文章图片" class="article-img">
                    <div class="article-content">
                        <div class="article-date">2023年5月15日</div>
                        <h3 class="article-title">简约设计的力量</h3>
                        <p class="article-excerpt">探讨简约设计如何在现代网页设计中发挥重要作用，以及如何通过减少元素来提升用户体验。</p>
                        <a href="#" class="read-more">阅读更多 ›</a>
                    </div>
                </div>
                <div class="article-card">
                    <img src="https://picsum.photos/600/400?random=5" alt="文章图片" class="article-img">
                    <div class="article-content">
                        <div class="article-date">2023年4月28日</div>
                        <h3 class="article-title">响应式布局最佳实践</h3>
                        <p class="article-excerpt">分享在创建响应式网站时的一些实用技巧和方法，帮助开发者构建适应各种设备的网站。</p>
                        <a href="#" class="read-more">阅读更多 ›</a>
                    </div>
                </div>
                <div class="article-card">
                    <img src="https://picsum.photos/600/400?random=6" alt="文章图片" class="article-img">
                    <div class="article-content">
                        <div class="article-date">2023年4月10日</div>
                        <h3 class="article-title">原生JavaScript的魅力</h3>
                        <p class="article-excerpt">为什么在框架盛行的时代，我们仍然需要掌握原生JavaScript？本文将为您解答。</p>
                        <a href="#" class="read-more">阅读更多 ›</a>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 个人信息区域 -->
    <section class="section about">
        <div class="container">
            <h2 class="section-title">关于我</h2>
            <div class="about-content">
                <div class="about-img">
                    <img src="https://picsum.photos/500/600?random=7" alt="个人照片">
                </div>
                <div class="about-text">
                    <h3>你好，我是Alex</h3>
                    <p>一名前端开发工程师，专注于创建简洁、优雅且用户友好的网页体验。我热爱技术，也热爱设计，相信技术与艺术的结合能创造出令人惊叹的作品。</p>
                    <p>在我的博客中，我会分享关于前端开发、用户体验设计以及个人成长的思考。希望我的分享能为你带来启发。</p>
                    <p>除了编程，我还喜欢摄影、旅行和阅读。我相信生活中的美好瞬间值得被记录和分享。</p>
                    <div class="social-links">
                        <a href="#" class="social-link">微博</a>
                        <a href="#" class="social-link">GitHub</a>
                        <a href="#" class="social-link">LinkedIn</a>
                        <a href="#" class="social-link">邮箱</a>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="container">
            <p>&copy; 2023 MyBlog. 保留所有权利。</p>
            <p>用 ❤️ 制作的简约个人博客</p>
        </div>
    </footer>

    <script>
        // 移动端导航菜单切换
        document.querySelector('.mobile-toggle').addEventListener('click', function() {
            document.querySelector('.nav-links').classList.toggle('active');
        });

        // 轮播图功能
        document.addEventListener('DOMContentLoaded', function() {
            const carouselItems = document.querySelectorAll('.carousel-item');
            const indicators = document.querySelectorAll('.indicator');
            const prevBtn = document.querySelector('.carousel-btn.prev');
            const nextBtn = document.querySelector('.carousel-btn.next');
            let currentIndex = 0;
            let autoSlideInterval;

            // 显示指定索引的幻灯片
            function showSlide(index) {
                // 隐藏所有幻灯片
                carouselItems.forEach(item => item.classList.remove('active'));
                indicators.forEach(indicator => indicator.classList.remove('active'));
                
                // 显示当前幻灯片
                carouselItems[index].classList.add('active');
                indicators[index].classList.add('active');
                currentIndex = index;
            }

            // 下一张幻灯片
            function nextSlide() {
                let nextIndex = currentIndex + 1;
                if (nextIndex >= carouselItems.length) {
                    nextIndex = 0;
                }
                showSlide(nextIndex);
            }

            // 上一张幻灯片
            function prevSlide() {
                let prevIndex = currentIndex - 1;
                if (prevIndex < 0) {
                    prevIndex = carouselItems.length - 1;
                }
                showSlide(prevIndex);
            }

            // 自动播放
            function startAutoSlide() {
                autoSlideInterval = setInterval(nextSlide, 5000);
            }

            // 停止自动播放
            function stopAutoSlide() {
                clearInterval(autoSlideInterval);
            }

            // 事件监听
            prevBtn.addEventListener('click', function() {
                stopAutoSlide();
                prevSlide();
                startAutoSlide();
            });

            nextBtn.addEventListener('click', function() {
                stopAutoSlide();
                nextSlide();
                startAutoSlide();
            });

            indicators.forEach(indicator => {
                indicator.addEventListener('click', function() {
                    stopAutoSlide();
                    const slideIndex = parseInt(this.getAttribute('data-slide'));
                    showSlide(slideIndex);
                    startAutoSlide();
                });
            });

            // 鼠标悬停时停止自动播放
            const carousel = document.querySelector('.carousel');
            carousel.addEventListener('mouseenter', stopAutoSlide);
            carousel.addEventListener('mouseleave', startAutoSlide);

            // 初始化自动播放
            startAutoSlide();
        });
    </script>
</body>
</html>